cell_area.y += vertical_separator/2;
if (gtk_tree_view_is_expander_column (tree_view, column))
{
- cell_area.x += (depth - 1) * tree_view->priv->level_indentation;
+ if (!rtl)
+ cell_area.x += (depth - 1) * tree_view->priv->level_indentation;
cell_area.width -= (depth - 1) * tree_view->priv->level_indentation;
if (TREE_VIEW_DRAW_EXPANDERS (tree_view))
if (gtk_tree_view_is_expander_column (tree_view, column))
{
- cell_area.x += (depth - 1) * tree_view->priv->level_indentation;
+ if (!rtl)
+ cell_area.x += (depth - 1) * tree_view->priv->level_indentation;
cell_area.width -= (depth - 1) * tree_view->priv->level_indentation;
if (TREE_VIEW_DRAW_EXPANDERS(tree_view))
gtk_tree_view_is_expander_column (tree_view, column))
{
gint depth = gtk_tree_path_get_depth (path);
+ gboolean rtl;
- rect->x += (depth - 1) * tree_view->priv->level_indentation;
+ rtl = gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL;
+
+ if (!rtl)
+ rect->x += (depth - 1) * tree_view->priv->level_indentation;
rect->width -= (depth - 1) * tree_view->priv->level_indentation;
if (TREE_VIEW_DRAW_EXPANDERS (tree_view))
{
- rect->x += depth * tree_view->priv->expander_size;
+ if (!rtl)
+ rect->x += depth * tree_view->priv->expander_size;
rect->width -= depth * tree_view->priv->expander_size;
}
GdkDrawable *drawable;
gint bin_window_width;
gboolean is_separator = FALSE;
+ gboolean rtl;
g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL);
g_return_val_if_fail (path != NULL, NULL);
bin_window_width + 2,
background_area.height + 2);
- for (list = tree_view->priv->columns; list; list = list->next)
+ rtl = gtk_widget_get_direction (GTK_WIDGET (tree_view)) == GTK_TEXT_DIR_RTL;
+
+ for (list = (rtl ? g_list_last (tree_view->priv->columns) : g_list_first (tree_view->priv->columns));
+ list;
+ list = (rtl ? list->prev : list->next))
{
GtkTreeViewColumn *column = list->data;
GdkRectangle cell_area;
background_area.x = cell_offset;
background_area.width = column->width;
+ gtk_widget_style_get (widget,
+ "vertical-separator", &vertical_separator,
+ NULL);
+
cell_area = background_area;
- gtk_widget_style_get (widget, "vertical-separator", &vertical_separator, NULL);
cell_area.y += vertical_separator / 2;
cell_area.height -= vertical_separator;
if (gtk_tree_view_is_expander_column (tree_view, column))
{
- cell_area.x += (depth - 1) * tree_view->priv->level_indentation;
+ if (!rtl)
+ cell_area.x += (depth - 1) * tree_view->priv->level_indentation;
cell_area.width -= (depth - 1) * tree_view->priv->level_indentation;
if (TREE_VIEW_DRAW_EXPANDERS(tree_view))
{
- cell_area.x += depth * tree_view->priv->expander_size;
+ if (!rtl)
+ cell_area.x += depth * tree_view->priv->expander_size;
cell_area.width -= depth * tree_view->priv->expander_size;
}
}
area = cell_area;
cell = _gtk_tree_view_column_get_edited_cell (tree_view->priv->focus_column);
+
_gtk_tree_view_column_get_neighbor_sizes (tree_view->priv->focus_column, cell, &left, &right);
area.x += left;
if (list->next)
{
- real_background_area.width = info->real_width + horizontal_separator + depth ;
+ real_background_area.width = info->real_width + depth;
}
else
{
&real_expose_area,
flags);
}
-
/* FOCUS */
else if (action == CELL_ACTION_FOCUS)
{
flags &= ~GTK_CELL_RENDERER_FOCUSED;
- real_cell_area.x += (real_cell_area.width + tree_column->spacing);
- real_background_area.x += (real_background_area.width + tree_column->spacing - (2 * focus_line_width ));
+ real_cell_area.x += (real_cell_area.width + 2 * focus_line_width + tree_column->spacing);
+ real_background_area.x += real_background_area.width + tree_column->spacing;
/* Only needed for first cell */
- depth=0;
+ depth = 0;
}
/* iterate list for PACK_END cells */
real_cell_area.width = info->real_width;
real_cell_area.width -= 2 * focus_line_width;
- real_background_area.width = info->real_width + horizontal_separator + depth;
+ real_background_area.width = info->real_width + depth;
rtl_cell_area = real_cell_area;
rtl_background_area = real_background_area;
cell_area->x + cell_area->width > ((GdkEventButton *)event)->x)
try_event = TRUE;
}
- else if (real_cell_area.x <= ((GdkEventButton *)event)->x &&
- real_cell_area.x + real_cell_area.width > ((GdkEventButton *)event)->x)
+ else if (rtl_cell_area.x <= ((GdkEventButton *)event)->x &&
+ rtl_cell_area.x + rtl_cell_area.width > ((GdkEventButton *)event)->x)
/* only activate cell if the user clicked on an individual
* cell
*/
flags &= ~GTK_CELL_RENDERER_FOCUSED;
- real_cell_area.x += (real_cell_area.width + tree_column->spacing);
+ real_cell_area.x += (real_cell_area.width + 2 * focus_line_width + tree_column->spacing);
real_background_area.x += (real_background_area.width + tree_column->spacing);
+
+ /* Only needed for first cell */
+ depth = 0;
}
/* fill focus_rectangle when required */
break;
if (info->cell->visible)
- l += info->real_width;
+ l += info->real_width + column->spacing;
}
while (list)
list = gtk_tree_view_column_cell_next (column, list);
if (info->cell->visible)
- r += info->real_width;
+ r += info->real_width + column->spacing;
}
rtl = (gtk_widget_get_direction (GTK_WIDGET (column->tree_view)) == GTK_TEXT_DIR_RTL);